from pages.base_page import BasePage


class TopLotteryPage(BasePage):
    published_button = '//*[@text="已公布"]'
    no_start = '//*[@text="待开始"]'
    top_title = '//*[@resource-id="cool.dingstock.mobile:id/common_titlebar_title_tv"]'
    back_button = '//*[@resource-id="cool.dingstock.mobile:id/common_titlebar_left_icon"]'
    
    def get_top_title(self):
        """顶部title内容"""
        return self.get_xpath_text(self.top_title)
    
    def click_published(self):
        """切换到已发布"""
        self.click_xpath(self.published_button)
        
    def click_no_start(self):
        """"切换到未开始"""
        self.click_xpath(self.no_start)
        
    def go_back(self):
        """返回主页"""
        self.click_xpath(self.back_button)